name = '中文'
# 输出类型
print(type(name))

# 字符串拼接
num1 = 11
num2 = 22
print("msg: 数字1=%s 数字2=%s" % (num1, num2))

"""
字符串格式化方式：f"{占位}"
"""
year = 2023
price = 19.00
print(f"name: {name}, year: {year}, price: {price}")

"""
表达式格式化
"""
print(f"res: {year * price} 类型: {type(year)}")

book = " Magic Tree House "
# index 方法
index = book.index("Tree")
print(f"Tree 起始索引是: {index}")

# strip 方法
print(f"去除前后空格: {book.strip()}")
print(f"去除前后 ae 任意字符: {book.strip().strip('ae')}")

# 字符串 切片
str1 = "01234567"
# 步长2
res = str1[::2]
print(f"字符串切片: {res}")
